/**
* @author AlbertDarren
* @contact 2563491540@qq.com
*/
#include <iostream>
#include <vector>
using namespace std;

int main_18()
{
    vector<int> v1;
    int cnt=0;
    vector<int>::iterator iter=v1.begin();
    for (int i=0;i<20 ;++i )
    {
        cout << "Size:"<<v1.size()<<" Capacity: "<<v1.capacity() << endl;
        v1.push_back(i);
        if (iter!=v1.begin())
        {
            cnt++;
            iter=v1.begin();
        }
    }
    cout << "vector container creates "<<cnt<<" arrays." << endl;
    v1.reserve(40);
    cout << "Size:"<<v1.size()<<" Capacity: "<<v1.capacity() << endl;
    return 0;
}
